<%--
  Created by IntelliJ IDEA.
  User: val
  Date: 2016/10/9
  Time: 08:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="/pages/sysIndex/default.jsp"/>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>报表中心</title>

    <link rel="shortcut icon" href="favicon.ico">
    <link href="<c:url value="/resources/fonts/font-awesome.css" />" rel="stylesheet">

    <!-- Morris -->
    <%--<link href="<c:url value="/resources/hplus/lib/css/plugins/morris/morris-0.4.3.min.css" />" rel="stylesheet">--%>

    <!-- Gritter -->
    <%--<link href="<c:url value="/resources/hplus/lib/js/plugins/gritter/jquery.gritter.css" />" rel="stylesheet">--%>

    <link href="<c:url value="/resources/plugins/css/animate.css" />" rel="stylesheet">
    <link href="<c:url value="/resources/plugins/css/style.css?v=4.1.0" />" rel="stylesheet">

    <style>
        .g2 .pieLabel {
            color: #FFF;
        }

        .g0 .pieLabel {
            color: #FFF;
        }

        .pull-left-force {
            float: left !important;
        }

        .padding-top-5 {
            padding-top: 5px !important;
        }

        .padding-top-15 {
            padding-top: 15px !important;
        }

        .padding-bot-15 {
            padding-bottom: 15px !important;
        }

        .margin-bottom-25 {
            margin-bottom: 25px !important;
        }

        .text-primary {
            color: #1ab394;
        }

        .total h1, h2 {
            font-weight: 200 !important;
        }

        .col-sm-6 {
            width: 33.3%;
        }

        .orderInput {
            border: 1px solid #b8b8b8;
            border-bottom: 1px solid #ccc;
            border-right: 0;
            vertical-align: top;
            outline: none;
            box-shadow: none;
        }

        /*.inmodal .modal-header{*/
        /*padding: 6px 15px;*/
        /*}*/


    </style>
</head>

<body class="gray-bg" onscroll="scroll()">
<div class="wrapper wrapper-content" style="height: 760px">

    <%--<div class="row">--%>
    <%--<div class="col-sm-12">--%>
    <%--<div class="ibox tabs-container ibox-content">--%>
    <%--<div class="tab-content" style="height: 40px;">--%>
    <%--<div style="width: 11%;float: left;">--%>
    <%--<select class="form-control" id="wms_select_top" style="width: 90%;">--%>
    <%--<option selected value="order">订单查询</option>--%>
    <%--<option value="commodity">库存查询</option>--%>
    <%--</select>--%>
    <%--</div>--%>
    <%--<div style="width: 78%;float: left;" id="bigInput">--%>
    <%--<input type="text" id="taobaoOrderId" name="taobaoOrderId" class="form-control orderInput">--%>
    <%--</div>--%>
    <%--<div style="width: 10%;float: left;">--%>
    <%--<a class="open-small-chat" style="border-radius: 0;height: 34px;width: 100%;"--%>
    <%--onclick="showDetail()">--%>
    <%--查询--%>
    <%--</a>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox col-sm-12">
                <div class="ibox-title">
                    工单信息
                    <input type="hidden" id="remark" value="${remark}">
                </div>
                <div class="ibox-content col-sm-12 padding-top-15" style="height:138px;">

                    <c:forEach items="${applicationModuleSet}" var="application">
                        <c:if test="${application.remark=='REPAIR'}">
                        <div class="col-sm-3 text-warning text-center" style="cursor: pointer">
                            <h1 style="font-size: 50px">${repairRecord}</h1>
                            <small>
                                维修工单数
                            </small>
                        </div>
                        </c:if>
                        <c:if test="${application.remark=='MAINTAIN'}">
                            <div class="col-sm-3 text-primary text-center" style="cursor: pointer">
                                <h1 style="font-size: 50px">${maintainRecord}</h1>
                                <small>维护保养工单数</small>
                            </div>
                        </c:if>
                        <c:if test="${application.remark=='INSPECTION'}">
                            <div class="col-sm-3 text-success text-center" style="cursor: pointer">
                                <h1 style="font-size: 50px">${inspectionRecord}</h1>
                                <small>抄表巡检工单数</small>
                            </div>
                        </c:if>
                        <c:if test="${application.remark=='TASK'}">
                            <div class="col-sm-3 text-danger text-center" style="cursor: pointer">
                                <h1 style="font-size: 50px">${taskRecord}</h1>
                                <small>
                                    任务工单数
                                </small>
                            </div>
                        </c:if>
                    </c:forEach>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <table class="table table-bordered" style="background-color: white;">
                <%-- <thead>
                 <tr id="tablehead">
                     <th></th>
                 </tr>
                 </thead>--%>
                <tr>
                    <th width="100px" rowspan="2">分类</th>
                    <th width="100px" colspan="${applicationModuleSet.size()}">今日</th>
                    <th width="100px" colspan="${applicationModuleSet.size()}">昨日</th>
                </tr>
                <tr>
                    <c:forEach items="${applicationModuleSet}" var="application">
                        <c:if test="${application.remark=='REPAIR'}">
                            <td width="100px">维修管理</td>
                        </c:if>
                        <c:if test="${application.remark=='MAINTAIN'}">
                            <td width="100px">维护保养</td>
                        </c:if>
                        <c:if test="${application.remark=='INSPECTION'}">
                            <td width="100px">抄表巡检</td>
                        </c:if>
                        <c:if test="${application.remark=='TASK'}">
                            <td width="100px">任务工单</td>
                        </c:if>
                    </c:forEach>
                    <c:forEach items="${applicationModuleSet}" var="application">
                        <c:if test="${application.remark=='REPAIR'}">
                            <td width="100px">维修管理</td>
                        </c:if>
                        <c:if test="${application.remark=='MAINTAIN'}">
                            <td width="100px">维护保养</td>
                        </c:if>
                        <c:if test="${application.remark=='INSPECTION'}">
                            <td width="100px">抄表巡检</td>
                        </c:if>
                        <c:if test="${application.remark=='TASK'}">
                            <td width="100px">任务工单</td>
                        </c:if>
                    </c:forEach>
                </tr>
                <tr>
                    <td style="width: 8%;">未接单</td>
                    <c:forEach items="${unTakingList}" var="unTaking">
                        <td style="width: ${orderWidth};">${unTaking}</td>
                    </c:forEach>
                </tr>
                <tr>
                    <td>未完成</td>
                    <c:forEach items="${unCompleteList}" var="unComplete">
                        <td>${unComplete}</td>
                    </c:forEach>
                </tr>
                <tr>
                    <td>待审核</td>
                    <c:forEach items="${auditList}" var="audit">
                        <td>${audit}</td>
                    </c:forEach>
                </tr>
                <tr>
                    <td>已完成</td>
                    <c:forEach items="${completeList}" var="complete">
                        <td>${complete}</td>
                    </c:forEach>
                </tr>
                <%--<tr>--%>
                <%--<td>工单异常</td>--%>
                <%--<c:forEach items="${warehouseOrderList.RECEIVE_YET}" var="RECEIVE_YET">--%>
                <%--<td>${RECEIVE_YET}</td>--%>
                <%--</c:forEach>--%>
                <%--</tr>--%>
                <%--<tr>--%>
                <%--<td>已取消</td>--%>
                <%--<c:forEach items="${warehouseOrderList.SCANNING_ORDER}" var="SCANNING_ORDER">--%>
                <%--<td>${SCANNING_ORDER}</td>--%>
                <%--</c:forEach>--%>
                <%--</tr>--%>
                <%--<tr>--%>
                <%--<td>已延期</td>--%>
                <%--<c:forEach items="${warehouseOrderList.WEIGH_ORDER}" var="WEIGH_ORDER">--%>
                <%--<td>${WEIGH_ORDER}</td>--%>
                <%--</c:forEach>--%>
                <%--</tr>--%>
            </table>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox tabs-container ibox-content">
                <h3>
                    工单
                </h3>
                <ul class="nav nav-tabs">
                    <li class="active"><a data-toggle="tab" href="#g1-tab-1" aria-expanded="true">今日</a>
                    </li>
                    <li><a data-toggle="tab" href="#g1-tab-2" aria-expanded="false">近7天</a>
                    </li>
                    <li><a data-toggle="tab" href="#g1-tab-3" aria-expanded="false">近30天</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div id="g1-tab-1" class="tab-pane active">
                        <div class="panel-body flot-chart">
                            <label>
                                工单
                            </label>
                            <div class="flot-chart-content" id="orderTodayChart"></div>
                        </div>
                    </div>
                    <div id="g1-tab-2" class="tab-pane">
                        <div class="panel-body flot-chart">
                            <div class="flot-chart-content" id="orderWeekChart"></div>
                        </div>
                    </div>
                    <div id="g1-tab-3" class="tab-pane">
                        <div class="panel-body flot-chart">
                            <div class="flot-chart-content" id="orderMonthChart"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <%--<div class="row">--%>
    <%--<div class="col-sm-12">--%>
    <%--<div class="ibox tabs-container ibox-content">--%>
    <%--<ul class="nav nav-tabs g2">--%>
    <%--<li class="active"><a data-toggle="tab" href="#g2-tab-1" aria-expanded="true">今日</a>--%>
    <%--</li>--%>
    <%--<li><a data-toggle="tab" href="#g2-tab-2" aria-expanded="true">近7天</a>--%>
    <%--</li>--%>
    <%--<li><a data-toggle="tab" href="#g2-tab-3" aria-expanded="true">近30天</a>--%>
    <%--</li>--%>
    <%--</ul>--%>
    <%--<div class="tab-content g2">--%>
    <%--<div id="g2-tab-1" class="tab-pane active">--%>
    <%--<div class="panel-body no-padding">--%>
    <%--<div class="col-sm-12">--%>
    <%--<div class="col-left" style="width:50%;float: left">--%>
    <%--<div class="col-sm-6 margin-bottom-25 padding-top-15" style="width: 50%">--%>
    <%--<h4 class="text-center">--%>
    <%--发单数量--%>
    <%--</h4>--%>
    <%--<div class="ibox-content flot-chart no-padding padding-top-15">--%>
    <%--<div id="orderTodayPieChart" class="flot-chart-content">--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div class="col-sm-6 margin-bottom-25 padding-top-15" style="width: 50%">--%>
    <%--<h4 class="text-center">--%>
    <%--异常情况--%>
    <%--</h4>--%>
    <%--<div class="ibox-content flot-chart no-padding padding-top-15">--%>
    <%--<div id="unusualTodayPieChart" class="flot-chart-content">--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div class="col-sm-6 margin-bottom-25 padding-top-15" style="width: 50%">--%>
    <%--<h4 class="text-center">--%>
    <%--取消工单占比--%>
    <%--</h4>--%>
    <%--<div class="ibox-content flot-chart no-padding padding-top-15">--%>
    <%--<div id="cancelTodayPieChart" class="flot-chart-content">--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div class="col-sm-6 margin-bottom-25 padding-top-15" style="width: 50%">--%>
    <%--<h4 class="text-center">--%>
    <%--延期工单占比--%>
    <%--</h4>--%>
    <%--<div class="ibox-content flot-chart no-padding padding-top-15">--%>
    <%--<div id="delayTodayPieChart" class="flot-chart-content">--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div id="g2-tab-2" class="tab-pane">--%>
    <%--<div class="panel-body no-padding">--%>
    <%--<div class="col-sm-12">--%>
    <%--<div class="col-left" style="width:50%;float: left">--%>
    <%--<div class="col-sm-6 margin-bottom-25 padding-top-15" style="width: 50%">--%>
    <%--<h4 class="text-center">--%>
    <%--发单数量--%>
    <%--</h4>--%>
    <%--<div class="ibox-content flot-chart no-padding padding-top-15">--%>
    <%--<div id="orderWeekPieChart" class="flot-chart-content">--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div class="col-sm-6 margin-bottom-25 padding-top-15" style="width: 50%">--%>
    <%--<h4 class="text-center">--%>
    <%--异常情况--%>
    <%--</h4>--%>
    <%--<div class="ibox-content flot-chart no-padding padding-top-15">--%>
    <%--<div id="unusualWeekPieChart" class="flot-chart-content">--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div class="col-sm-6 margin-bottom-25 padding-top-15" style="width: 50%">--%>
    <%--<h4 class="text-center">--%>
    <%--取消工单占比--%>
    <%--</h4>--%>
    <%--<div class="ibox-content flot-chart no-padding padding-top-15">--%>
    <%--<div id="cancelWeekPieChart" class="flot-chart-content">--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div class="col-sm-6 margin-bottom-25 padding-top-15" style="width: 50%">--%>
    <%--<h4 class="text-center">--%>
    <%--延期工单占比--%>
    <%--</h4>--%>
    <%--<div class="ibox-content flot-chart no-padding padding-top-15">--%>
    <%--<div id="delayWeekPieChart" class="flot-chart-content">--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div id="g2-tab-3" class="tab-pane">--%>
    <%--<div class="panel-body no-padding">--%>
    <%--<div class="col-sm-12">--%>
    <%--<div class="col-left" style="width:50%;float: left">--%>
    <%--<div class="col-sm-6 margin-bottom-25 padding-top-15" style="width: 50%">--%>
    <%--<h4 class="text-center">--%>
    <%--发单数量--%>
    <%--</h4>--%>
    <%--<div class="ibox-content flot-chart no-padding padding-top-15">--%>
    <%--<div id="orderMonthPieChart" class="flot-chart-content">--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div class="col-sm-6 margin-bottom-25 padding-top-15" style="width: 50%">--%>
    <%--<h4 class="text-center">--%>
    <%--异常情况--%>
    <%--</h4>--%>
    <%--<div class="ibox-content flot-chart no-padding padding-top-15">--%>
    <%--<div id="unusualMonthPieChart" class="flot-chart-content">--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div class="col-sm-6 margin-bottom-25 padding-top-15" style="width: 50%">--%>
    <%--<h4 class="text-center">--%>
    <%--取消工单比重--%>
    <%--</h4>--%>
    <%--<div class="ibox-content flot-chart no-padding padding-top-15">--%>
    <%--<div id="cancelMonthPieChart" class="flot-chart-content">--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div class="col-sm-6 margin-bottom-25 padding-top-15" style="width: 50%">--%>
    <%--<h4 class="text-center">--%>
    <%--延期工单比重--%>
    <%--</h4>--%>
    <%--<div class="ibox-content flot-chart no-padding padding-top-15">--%>
    <%--<div id="delayMonthPieChart" class="flot-chart-content">--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
</div>
</div>


<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script src="<c:url value="/resources/plugins/flot/jquery.flot.js" />"></script>
<script src="<c:url value="/resources/plugins/flot/jquery.flot.tooltip.min.js" />"></script>
<script src="<c:url value="/resources/plugins/flot/jquery.flot.spline.js" />"></script>
<script src="<c:url value="/resources/plugins/flot/jquery.flot.resize.js" />"></script>
<script src="<c:url value="/resources/plugins/flot/jquery.flot.pie.js" />"></script>
<script src="<c:url value="/resources/plugins/flot/jquery.flot.symbol.js" />"></script>
<script src="<c:url value="/resources/plugins/js/peity/jquery.peity.min.js" />"></script>
<%--<script src="<c:url value="/resources/hplus/lib/js/demo/peity-demo.js" />"></script>--%>
<%--<script src="<c:url value="/resources/hplus/lib/js/content.js?v=1.0.0" />"></script>--%>
<script src="<c:url value="/resources/plugins/js/jquery-ui/jquery-ui.min.js" />"></script>
<script src="<c:url value="/resources/plugins/js/jvectormap/jquery-jvectormap-1.2.2.min.js" />"></script>
<script src="<c:url value="/resources/plugins/js/jvectormap/jquery-jvectormap-world-mill-en.js" />"></script>
<script src="<c:url value="/resources/plugins/js/easypiechart/jquery.easypiechart.js" />"></script>
<script src="<c:url value="/resources/plugins/js/sparkline/jquery.sparkline.min.js" />"></script>
<%--<script src="<c:url value="/resources/hplus/lib/js/demo/sparkline-demo.js" />"></script>--%>
<%--<script src="<c:url value="/resources/js/jquery.blockUI.js" />"></script>--%>
<%--<script src="<c:url value="/resources/js/config.js" />"></script>--%>
<%--<script src="<c:url value="/resources/js/jbase64.js" />"></script>--%>
<script>
    var index = 0;

    <%--function orderBaseShow(status) {--%>
    <%--$('#myModal5').modal('show');--%>
    <%--var myDate = new Date();--%>
    <%--var month = myDate.getMonth() + 1;--%>
    <%--var date = myDate.getFullYear() + "-" + month + "-" + myDate.getDate();--%>
    <%--var startDate = date + " 00:00:00";--%>
    <%--var endDate = date + " 23:59:59";--%>
    <%--console.log(startDate);--%>
    <%--console.log(endDate);--%>
    <%--document.getElementById("iframe0").src = "<c:url value="/web/admin/orderBase/getOrderBaseListPage.action?status="/>" + status + "&createStartDate=" + startDate + "&createEndDate=" + endDate;--%>
    <%--}--%>

    <%--function expressShow() {--%>
    <%--$('#myModal5').modal('show');--%>
    <%--document.getElementById("iframe0").src = "<c:url value="/logistics/getLogisticsDetailsListPage.action?inLogisticsState=Abnormal,SingleTurn,Return,BackSign,Difficult"/>";--%>
    <%--}--%>

    function scroll() {
        if (index != 0) {
            return false;
        }
        index = 1;
        scrollData();
    }

    function clone(obj) {
        var o;
        if (typeof obj == "object") {
            if (obj === null) {
                o = null;
            } else {
                if (obj instanceof Array) {
                    o = [];
                    for (var i = 0, len = obj.length; i < len; i++) {
                        o.push(clone(obj[i]));
                    }
                } else {
                    o = {};
                    for (var j in obj) {
                        o[j] = clone(obj[j]);
                    }
                }
            }
        } else {
            o = obj;
        }
        return o;
    }

    function getDateStr(subDayCount) {
        var dd = new Date();
        dd.setDate(dd.getDate() - subDayCount);//获取AddDayCount天后的日期
        var y = dd.getFullYear();
        var m = dd.getMonth() + 1;//获取当前月份的日期
        var d = dd.getDate();
        return m + "/" + d;
    }

    function scrollData() {
        var repairTodayModel;
        var repairWeekModel;
        var repairMonthModel;
        var maintainTodayModel;
        var maintainWeekModel;
        var maintainMonthModel;
        var inspectionWeekModel;
        var inspectionMonthModel;
        var inspectionTodayModel;
        var taskWeekModel;
        var taskMonthModel;
        var taskTodayModel;
        $.ajax({
            type: 'POST',
            url: '<c:url value="/web/admin/getDashBoard/getWelcomeData.action" />',
            data: {},
            async: false,
            success: function (a) {
                repairTodayModel = a.repairTodayModel;
                repairWeekModel = a.repairWeekModel;
                repairMonthModel = a.repairMonthModel;

                maintainTodayModel = a.maintainTodayModel;
                maintainWeekModel = a.maintainWeekModel;
                maintainMonthModel = a.maintainMonthModel;

                inspectionTodayModel = a.inspectionTodayModel;
                inspectionWeekModel = a.inspectionWeekModel;
                inspectionMonthModel = a.inspectionMonthModel;

                taskWeekModel = a.taskWeekModel;
                taskMonthModel = a.taskMonthModel;
                taskTodayModel = a.taskTodayModel;
            },
            error: function () {
                alert('ajax error!');
            }
        });
        var todayTicks = [
            [0, '00:00'],
            [1, '01:00'],
            [2, '02:00'],
            [3, '03:00'],
            [4, '04:00'],
            [5, '05:00'],
            [6, '06:00'],
            [7, '07:00'],
            [8, '08:00'],
            [9, '09:00'],
            [10, '10:00'],
            [11, '11:00'],
            [12, '12:00'],
            [13, '13:00'],
            [14, '14:00'],
            [15, '15:00'],
            [16, '16:00'],
            [17, '17:00'],
            [18, '18:00'],
            [19, '19:00'],
            [20, '20:00'],
            [21, '21:00'],
            [22, '22:00'],
            [23, '23:00'],
        ];

        var weekTicks = [];
        var monthTicks = [];

        for (var i = 0; i < 8; i++) {
            weekTicks.push([
                    i, getDateStr(6 - i)
                ]
            )
        }
        for (var i = 0; i < 31; i++) {
            monthTicks.push([
                    i, getDateStr(30 - i)
                ]
            )
        }
        var todayDataSet = [];
        var weekDataSet = [];
        var monthDataSet = [];
        var remarkList = $("#remark").val().split(",");
        for (var i = 0; i < remarkList.length; i++) {
            if (remarkList[i] == "REPAIR") {
                todayDataSet.push({
                    label: "维修管理",
                    data: repairTodayModel,
                    color: "#f8ac59",
                });
                weekDataSet.push({
                    label: "维修管理",
                    data: repairWeekModel,
                    color: "#f8ac59",
                });
                monthDataSet.push({
                    label: "维修管理",
                    data: repairMonthModel,
                    color: "#f8ac59",
                })
            } else if (remarkList[i] == "MAINTAIN") {
                todayDataSet.push({
                    label: "维护保养",
                    data: maintainTodayModel,
                    color: "#1ab394",
                });
                weekDataSet.push({
                    label: "维护保养",
                    data: maintainWeekModel,
                    color: "#1ab394",
                });
                monthDataSet.push({
                    label: "维护保养",
                    data: maintainMonthModel,
                    color: "#1ab394",
                })
            } else if (remarkList[i] == "INSPECTION") {
                todayDataSet.push({
                    label: "抄表巡检",
                    data: inspectionTodayModel,
                    color: "#1c84c6",
                });
                weekDataSet.push({
                    label: "抄表巡检",
                    data: inspectionWeekModel,
                    color: "#1c84c6",
                });
                monthDataSet.push({
                    label: "抄表巡检",
                    data: inspectionMonthModel,
                    color: "#1c84c6",
                })

            }else if (remarkList[i] == "TASK") {
                todayDataSet.push({
                    label: "任务工单",
                    data: taskTodayModel,
                    color: "#ed5565",
                });
                weekDataSet.push({
                    label: "任务工单",
                    data: taskWeekModel,
                    color: "#ed5565",
                });
                monthDataSet.push({
                    label: "任务工单",
                    data: taskMonthModel,
                    color: "#ed5565",
                })

            }
        }


        var todayDataOptions = {
            series: {
                lines: {
                    show: true,
                    lineWidth: 2,
                    fill: true,
                    fillColor: {
                        colors: [{
                            opacity: 0.0
                        }, {
                            opacity: 0.0
                        }]
                    }
                }
            },
            colors: ["#1ab394"],
            xaxis: {
                ticks: todayTicks
            },
            yaxis: {
                min: 0,
                max: null,
                pad: 1,
                decimal: 0
            },
            grid: {
                hoverable: true,
                clickable: true,
                borderWidth: 0
            },
            legend: {
                show: true
            },
            tooltip: true,
            tooltipOpts: {
                content: "工单数量: %y"
            }

        };

        function showTooltip(x, y, contents) {
            $('<div id="tooltip">' + contents + '</div>').css({
                position: 'absolute',
                display: 'none',
                top: y + 10,
                left: x + 10,
                border: '1px solid #fdd',
                padding: '2px',
                'background-color': '#dfeffc',
                opacity: 0.80
            }).appendTo("body").fadeIn(200);
        }

        var previousPoint = null;
        // 绑定提示事件
        $("#orderTodayChart").bind("plothover", function (event, pos, item) {
            if (item) {
                if (previousPoint != item.dataIndex) {
                    previousPoint = item.dataIndex;
                    $("#tooltip").remove();
                    var y = item.datapoint[1].toFixed(0);

                    var tip = "工单数量：";
                    showTooltip(item.pageX, item.pageY, tip + y);
                }
            }
            else {
                $("#tooltip").remove();
                previousPoint = null;
            }
        });

        var weekDataOptions = clone(todayDataOptions);
        weekDataOptions.xaxis.ticks = weekTicks;

        var monthDataOptions = clone(todayDataOptions);
        monthDataOptions.xaxis.ticks = monthTicks;
        console.log(weekDataSet)

        $.plot($("#orderTodayChart"), todayDataSet, todayDataOptions);
        $.plot($("#orderWeekChart"), weekDataSet, weekDataOptions);
        $.plot($("#orderMonthChart"), monthDataSet, monthDataOptions);

    }


    $(window).scroll(function(){

    })
</script>
</body>

</html>